<?php //pack11class

class ObjectsListNavigationArrow extends Module {

    const BACK="back_arrow";
    const FORWARD="forward_arrow";
    public $traceEnabled=true;
    public $events="";

    public function setup() {
        if(!$this->param) return false;
        $setting=SettingsManager::getSetting("navigation");
        $naviSetting=clone $setting;
        $current=ObjectsListNavigation::getPageNumber();
        $naviSetting->value=($this->param==self::BACK)? $current-1:$current+1;
        $queryObject=new GetQueryObject();
        $queryObject=GetQuery::useDefinedVars();
        $queryObject->setValue($naviSetting, GetQueryObject::SETTING);
        $query=GetQuery::generate($queryObject);
        //trace(GetQuery::$qline);
        $link="?state=".$query;
        if(array_key_exists("search",$_GET)) $this->events=str_replace('\"', '"', "onClick=\"PostData.release('".$query."&search');\"");
            else $this->events=str_replace('\"', '"', "onClick=\"location.href='".$link."';\"");
        $label=LabelManager::getLabel($this->param."_label");
        $this->setClass("ObjectsListNavigation_".$this->param);
        $this->setBody($label);
    }

}
?>
